<template>
  <div class="home-page">
    <el-card class="welcome-card">
      <h1>欢迎使用惊喜一餐！</h1>
    </el-card>
    <el-row :gutter="20">
      <el-col :span="8" v-for="restaurant in recommendedRestaurants" :key="restaurant.id">
        <el-card class="restaurant-card">
          <img :src="restaurant.image" class="restaurant-image" />
          <div class="restaurant-info">
            <h3>{{ restaurant.name }}</h3>
            <el-rate v-model="restaurant.rating" disabled></el-rate>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      recommendedRestaurants: [
        // 假设的数据，实际应用中应从后端获取
        { id: 1, name: '餐厅A', image: 'path/to/image', rating: 4.5 },
        { id: 2, name: '餐厅B', image: 'path/to/image', rating: 4.8 },
        // 更多餐厅...
      ],
    };
  },
};
</script>

<style>
.home-page {
  padding: 20px;
}
.welcome-card {
  text-align: center;
}
.restaurant-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.restaurant-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.restaurant-info {
  margin-top: 10px;
}
</style>